ti816x u-boot

Table of Contents

Modify DDR3 Frequency

Currently the following are the supported frequencies on the DM816x EVM.

  • 400MHz
  • 531MHz
  • 675MHz
  • 796MHz

step 1

arch/arm/include/asm/arch-ti81xx/ddr_defs_ti816x.h

#define CONFIG_TI816X_DDR3_796 /* Values supported 400,531,675,796 */

step 2

arch/arm/include/asm/arch-ti81xx/clocks_ti816x.h

#define DDR_PLL_796     /* Values supported 400,531,675,796 */

step 3

Open the file include/configs/ti8168_evm.h and make sure that the config option for DDR3 is not commented and that for DDR2 is commented out as shown below

[...]
//#define CONFIG_TI816X_EVM_DDR3                  /* Configure DDR3 in U-Boot */
#define CONFIG_TI816X_EVM_DDR2                /* Configure DDR2 in U-Boot */
[...]

Modify serial console UART port

include/configs/ti8168_evm.h

/*
 * NS16550 Configuration
 */
//define CONFIG_SYS_NS16550_COM1                0x48024000      /* Base EVM has UART2 */
define CONFIG_SYS_NS16550_COM1          0x48020000      /* Base EVM has UART0 */

BOOT Mode

SPI boot mode

SW3---->BTM[4:0] ==> 10110   (other pins should be 0 i.e. OFF)
SW4---->SPI ON

SD boot mode

SW3---BTM[4:0] ==> 10111 (other pins should be 0 i.e. OFF)

Files

/board/ti/ti8168

|-- config.mk
|-- evm.c
|-- Makefile
`-- u-boot.lds

arch/arm/include/asm/arch-ti81xx/

|-- clock.h
|-- clocks_ti816x.h
|-- cpu.h
|-- ddr_defs.h
|-- ddr_defs_ti816x.h
|-- emac_defs.h
|-- hardware.h
|-- i2c.h
|-- mem.h
|-- mmc.h
|-- mmc_host_def.h
|-- nand.h
`-- sys_proto.h

include/configs/ti8168_evm.h

arch/arm/cpu/arm_cortexa8/ti81xx

|-- cache.S
|-- elm.c
|-- lowlevel_init.S
|-- Makefile
|-- mem.c
|-- sys_info.c
|-- syslib.c
`-- timer.c

Make

step1: make the mini u-boot

build\min.sh

#!/bin/sh
rm MLO
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm distclean
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm ti8168_evm_min_sd
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm u-boot.ti
mv u-boot.min.sd MLO

step2: make the normal u-boot

build\sd

#!/bin/sh
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm distclean
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm ti8168_evm_config
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm u-boot.ti

Result Files

1st stage u-boot configurations

Boot Modes Output File TI816x
NAND u-boot.min.nand single stage*
SPI u-boot.min.spi single stage*
NOR NA single stage*
SD u-boot.min.sd ti8168evmminsd
UART u-boot.min.uart Not supported
EMAC u-boot.min.eth single

2nd stage u-boot configurations

Boot Modes Output File TI816x NAND u-boot.bin.noxip (TI816x) ti8168evmconfignand u-boot.bin (TI814x/Ti813x) SPI u-boot.bin.noxip.spi ti8168evmconfigspi NOR u-boot.bin ti8168evmconfignor SD** u-boot.bin ti8168evmconfigsd UART NA Not supported EMAC u-boot.in use NAND/SPI/SD

Boot Linux Kernel

Boot from SD Card

TI8168_EVM# mmc rescan 0
TI8168_EVM# fatload mmc 0 0x81000000 uImage
TI8168_EVM# setenv bootargs 'console=ttyO0,115200n8 root=/dev/mmcblk0p2 mem=128M rootwait'
TI8168_EVM# bootm 0x81000000

Boot over Network (Ethernet)

  • Overview

    When kernel image and ramdisk image are fetched from a tftp server:

    1. Ensure that the EVM is connected to network with DHCP and TFTP server set up
    2. Set 'ethaddr' U-Boot environment variable with proper ethernet address in format 'xx:xx:xx:xx:xx:xx' (replace 'xx' with proper hexadecimal values)
    3. Copy kernel image and ramdisk to TFTP server's root directory.
    4. Execute follwing commands at U-Boot prompt. We assume kernel image name as 'uImage' and ramdisk file name as 'ramdisk.gz'
  • Method1 (DHCP) for ramdisk,gz
    TI8168_EVM# setenv autoload no
    TI8168_EVM# dhcp
    TI8168_EVM# setenv serverip <Server IP Address>
    TI8168_EVM# tftp 0x81000000 uImage
    TI8168_EVM# tftp 0x82000000 ramdisk.gz
    TI8168_EVM# setenv bootargs 'mem=200M console=ttyO0,115200n8 root=/dev/ram0 initrd=0x82000000,40M ramdisk_size=45000 ip=dhcp'
    TI8168_EVM# bootm 0x81000000
    
  • Method 2 for NFS Filesystem
    • static IP

      Alternatively, kernel can be made to use the same IP address as assigned to U-Boot instead of doing DHCP request again by setting U-Boot parameters as follows:

      TI8168_EVM# print ethaddr <-- Check if MAC address is assigned and is unique
      TI8168_EVM# setenv ethaddr <unique-MAC-address> <-- Set only if not present already, format xx:yy:zz:aa:bb:cc
      TI8168_EVM# setenv bootcmd 'dhcp;run addip; tftp 81000000 uImage;bootm'
      TI8168_EVM# setenv hostname <unique-hostname>
      TI8168_EVM# setenv addip 'setenv bootargs ${bootargs} ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}:${hostname}:eth0:off'
      TI8168_EVM# setenv autoload no
      TI8168_EVM# setenv nfsserver <nfs-server-ip> <-- Make sure the same NFS server IP is used below
      TI8168_EVM# setenv bootargs 'console=ttyO0,115200n8 root=/dev/nfs nfsroot=<nfs-server-ip>:<path-to-nfs-share>,nolock rw mem=128M'
      TI8168_EVM# setenv serverip <tftp-server-ip>
      TI8168_EVM# saveenv
      TI8168_EVM# boot
      
    • DHCP
      TI8168_EVM# print ethaddr <-- Check if MAC address is assigned and is unique
      TI8168_EVM# setenv ethaddr <unique-MAC-address> <-- Set only if not present already, format uv:yy:zz:aa:bb:cc
      TI8168_EVM# setenv bootcmd 'dhcp;tftp 81000000 uImage;bootm'
      TI8168_EVM# setenv autoload no
      TI8168_EVM# setenv nfsserver <NFS server-ip> <-- Make sure the same NFS server IP is used below
      TI8168_EVM# setenv bootargs 'console=ttyO2,115200n8 root=/dev/nfs nfsroot=<NFS server-ip>:<NFS share>,nolock rw mem=128M ip=dhcp'
      TI8168_EVM# setenv serverip <tftp-server-ip>
      TI8168_EVM# saveenv
      TI8168_EVM# boot
      
  • Example 1 (dhcp)
    setenv bootdelay 4
    setenv baudrate 115200
    setenv bootargs console=ttyO0,115200n8 rootwait rw mem=364M@0x80000000 mem=324M@0x9F900000 vmalloc=500M notifyk.vpssm3_sva=0xBF900000 root=/dev/nfs nfsroot=143.89.147.79:/home/testbed/targetfs ip=dhcp
    setenv bootcmd 'dhcp;setenv serverip 143.89.147.79;tftpboot;bootm'
    setenv autoload no
    setenv serverip 143.89.147.79
    setenv bootfile uImage
    
  • Example 2 (static ip)
    • host PC
    sudo  ifconfig eth0 10.2.1.10 netmask 255.255.255.0 up
    
    • ti816x board
    setenv ipaddr 10.2.1.9
    setenv serverip 10.2.1.10
    setenv bootcmd 'tftpboot 0x81000000 uImage; bootm 0x81000000'
    setenv autoload no
    setenv bootargs 'mem=128M console=ttyO0,115200n8 root=/dev/nfs rw  nfsroot=10.2.1.10:/home/testbed/targetfs  ip=10.2.1.9:10.2.1.10:10.2.1.1:255.255.255.0::eth0:off'
    boot
    

    or

    setenv bootargs 'console=ttyO0,115200n8 rootwait rw  mem=364M@0x80000000 mem=324M@0x9F900000 vmalloc=500M notifyk.vpssm3_sva=0xBF900000 root=/dev/nfs  nfsroot=10.2.1.10:/home/testbed/targetfs  ip=10.2.1.9:10.2.1.10:10.2.1.1:255.255.255.0::eth0:off'
    

ENV on SD card using a script

Example (boot.txt)

setenv bootargs 'console=ttyO0,115200n8 root=/dev/mmcblk0p2 mem=128M rootwait'
setenv bootcmd 'mmc rescan 0; fatload mmc 0 0x81000000 uImage; bootm 0x81000000'
boot

Now use the following command to generate the script named boot.scr

mkimage -A arm -O linux -T script -C none -n TI_script -d boot.txt boot.scr

TFTP

TI8168_EVM# tftp 0x81000000 boot.scr
TI8168_EVM# source 0x81000000

U-boot command

List files on a FAT32 formated SD card

TI8168_EVM# mmc rescan 0
TI8168_EVM# fatls mmc 0

Booting application (ex. u-boot.bin)image from the SD card

TI8168_EVM# mmc rescan 0
TI8168_EVM# fatload mmc 0 0x81000000 u-boot.bin
TI8168_EVM# go 0x81000000

mtest

mtest <start-address> <end-address> <test pattern> <# of iterations>
  • Example
    TI8168_EVM# mtest 0x80000000 0xA0000000 0xaa55aa55 3 (referred as Test A)
    TI8168_EVM# mtest 0xA0000000 0xC0000000 0xaa55aa55 3 (referred as Test B)
    

Set static ip

TI8168_EVM# setenv ipaddr <your static ip>

Bootargs

bootargs: The contents of this variable are passed to the Linux kernel as boot arguments (aka "command line").

mem

Mem is for declaring the total memory available to Linux.

notifyk.vpssm3_sva

notifyk.vpssm3_sva is the address shared between Media controller and A8 Linux for doing Notify calls. Notify is used by VPSS.ko and V4L2 drivers.

Author: Shi Shougang

Created: 2015-03-05 Thu 23:20

Emacs 24.3.1 (Org mode 8.2.10)

Validate